package com.rd.student.jike.class2.lihongming.week731_806.Day0803.Pet;

/**
 * @Auther:Heinrich
 * @Date:2023/8/2-08-02-14:13
 * @Description:c230802
 * @version:1.0
 */
public abstract class Animal {
    public Animal() {
    }

    String name;
    String Type;
    public Animal(String name,String type) {
        this.name = name;
        this.Type = type;
    }

    public abstract void voice();

    public abstract String enjoy();

    public abstract String getColor();

    @Override
    public String toString() {
        return Type+",名字叫："+name;
    }
}

class Cat extends Animal {
    String eyesColor;

    public String getColor() {
        return "有"+eyesColor+"的眼睛";
    }

    public Cat(String name) {
        super(name,"猫");
    }

    public Cat(String name, String eyesColor) {
        super(name,"猫");
        this.eyesColor = eyesColor;
    }

    @Override
    public void voice() {
        System.out.println("喵喵喵");
    }

    @Override
    public String enjoy() {
        return "玩毛线球";
    }

    @Override
    public String toString() {
        return super.toString()+","+getColor();
    }
}

class Pig extends Animal {
    public Pig(String name) {
        super(name,"猪");
    }

    @Override
    public void voice() {
        System.out.println("吭吭吭");
    }

    @Override
    public String enjoy() {
        return "满地打滚";
    }

    @Override
    public String getColor() {
        return "";
    }

    @Override
    public String toString() {
        return super.toString()+getColor();
    }
}

class Dog extends Animal {
    String furColor;
    public String getColor() {
        return "长着"+furColor+"的毛";
    }

    public Dog(String name, String furColor) {
        super(name,"狗");
        this.furColor = furColor;
    }

    @Override
    public void voice() {
        System.out.println("汪汪汪");
    }

    @Override
    public String enjoy() {
        return "叼飞盘";
    }

    @Override
    public String toString() {
        return super.toString()+","+getColor();
    }
}
